<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8" />
	<title>书店管理系统</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<link rel="stylesheet" type="text/css" href="/public/css/bootstrap.min.css" />
	<link rel="stylesheet" type="text/css" href="/public/css/swiper.min.css" />
	<link href="http://cdn.bootcss.com/animate.css/3.5.2/animate.min.css" rel="stylesheet" media="all">
	<link href="/public/css/bootstrap-touch-slider.css" rel="stylesheet" media="all">
	<link rel="stylesheet" type="text/css" href="/public/css/pc.css" />
	<link rel="stylesheet" type="text/css" media="screen and (max-width:1200px)" href="/public/css/ipad.css">
	<link rel="stylesheet" type="text/css" media="screen and (max-width:768px)" href="/public/css/phone.css">
	<script type="text/javascript" src="/public/js/jquery-1.11.1.min.js"></script>
	<script type="text/javascript" src="/public/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="/public/js/swiper.min.js"></script>
	<script type="text/javascript" src="/public/js/scrollReveal.js"></script>
	<script src="http://cdn.bootcss.com/jquery.touchswipe/1.6.18/jquery.touchSwipe.min.js"></script>
	<script src="/public/js/bootstrap-touch-slider-min.js"></script>
	<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=Diy1GpUowSnG4kyw93KWvG4GfQDm3xch"></script>

	<!-- 地区插件 -->
	<script src="/public/js/distpicker.data.js"></script>	
	<script src="/public/js/distpicker.js"></script>
	<script src="/public/js/main.js"></script>	

	<script type="text/javascript" src="/public/js/jquery.cookie.js"></script>
	<script type="text/javascript" src="/public/js/base64.js"></script>
	<script type="text/javascript" src="/public/js/xiuzhen.js"></script>
	<script>
		if ($(document.body).width() < 760) {
			document.documentElement.style.fontSize = document.documentElement.clientWidth / 7.5 + 'px';
		} else {
			document.documentElement.style.fontSize = document.documentElement.clientWidth / 1 + 'px';
		}
	</script>
	<!--兼容ie8-->
	<!--[if lt IE 9]>
	    <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
	    <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>
	<!-- 头部导航开始 -->
	<div class="header">
		<div class="nav">
			<img class="logo" src="/public/images/logo.png" alt="">
			<ul class="top">
				<li>
					<a href="index.html">首页</a>
				</li>
				<li>
					<a href="box.html">图书展示</a>
				</li>
				<li>
					<a href="labOne.html">图书资讯</a>
					<!-- <ul class="child">
						<li>
							<a href="labOne.html">科学实验室1</a>
						</li>
						<li>
							<a href="labTwo.html">科学实验室2</a>
						</li>
						<li>
							<a href="labThree.html">科学实验室3</a>
						</li>
					</ul> -->
				</li>
				<!-- <li>
					<a href="maker.html">创客课程</a>
				</li> -->
				<li>
					<a href="about.html">关于我们</a>
				</li>
				<li>
					<a href="contact.html">联系我们</a>
				</li>
			</ul>
			<div class="right">
				<a href="login.html" class="login">会员登陆</a>
				
				<a class="indexCart" href="cart.html">
					<img class="cart" src="/public/images/cart.png" alt="">
				</a>
				<a class="leaguer" href="member.html" style="display: none;">
					<img class="" src="/public/images/people2.png" alt="">
				</a>
				<p id="username" style="display: none;"></p>
				<!-- <p class="line"></p>
				<img class="weixin" src="images/weixin.png" alt=""> -->
			</div>
		</div>
	</div>
	
	<!-- 子页面位置公共样式 -->
	<div class="com-position member-position">
		<p class="container">
			<span>当前页面：</span>
			<a href="javascript:;">首页</a> >
			<a href="javascript:;">会员中心</a>
		</p>
	</div>

	<!-- 个人中心页面 -->
	<div class="member">
		<div class="container">
			<div class="left">
				<div class="head">
					<p class="china">会员中心</p>
					<p class="eng">Member Center</p>
				</div>
				<ul class="menu">
					<ul class="menu">
						<li><a href="member.html">我的个人资料</a></li>	
						<li><a href="order.html">我的订单</a></li>
						<li><a href="saleOrder.html" class="active">我的代售</a></li>
						<li><a href="address.html">我的收货地址</a></li>
						<li><a href="editPassword.html">修改密码</a></li>
						<li class="loginOut"><a href="javascript:;">退出</a></li>
					</ul>
				</ul>
			</div>
			<div class="right">
				<div class="title">我的订单</div>
				<div class="order">
					<div class="top">
						<div class="name">商品名称</div>
						<div class="people">收货人</div>
						<div class="price">价格</div>
						<div class="status">订单状态</div>
					</div>
					<div class="center">
						
					</div>
					<div class="bottom">
						<ul>
							
						</ul>
						
					</div>
				</div>
			</div>
		</div>
	</div>

	<!-- 预约弹框样式 -->
	<div class="appointShadow"></div>


	<!-- 右侧弹框 -->
	<div class="rightFrame">
		<div class="bespoke"><a href="saleApply.html">代售申请</a></div>
		<div class="placement"><img src="/public/images/top.png" alt="">置顶</div>
	</div>

	<!-- 弹框样式 -->
	<div class="alert-box">
		<span class="xz-alert alert alert-danger"></span>
	</div>

	<!-- 公共底部开始 -->
	<div class="footer">
		<div class="footer-content1">
			<div></div>
		</div>
		<div class="footer-content">
			<div class="container">
				<div class="content">
					<div class="left">
						<img class="bottom-logo" src="/public/images/logo.png" alt="">
						<p class="des">此网站为不仅为人们提供了便利的购书平台，还在此基础上增加了代售和出租的功能，人们有想卖的书籍可以在此平台申请，平台会帮忙代售，还有的宝宝们，不想购买书籍，此平台提供了租书的功能，不需要购买就可以便宜看到自己想看的书籍啦！！！</p>
					</div>
					<div class="right">
						<div class="contact">
							<p class="title">联系我们</p>
							<p class="phone">电话：0755-23324516</p>
							<p class="email">邮箱：cd.01@oil-com.com</p>
							<p class="email">QQ：1056598469</p>
						</div>
					</div>
				</div>
				<p class="copy">地址：山西省太原市万柏林区下元街道公园时代城2号楼1301</p><br>
			</div>
		</div>	
		
	</div>

	<!-- 微信支付二维码 -->
	<div class="com-shadow">
		<div class="img-box">
			<img src="http://qr.topscan.com/api.php?text=weixin://wxpay/bizpayurl?pr=kqngWS9" alt="">
			<p>用户打开“微信扫一扫”，扫描商户的二维码后完成支付</p>
		</div>
		<div class="com-close">x</div>
	</div>

	<script type="text/javascript">
		

		if(!$.cookie('uid')){
			location.href = './index.html';
		}

		var loginUrl = Base64.encode("order.html");  
		$('.header .nav .right .login').attr('href','./login.html?loginurl='+loginUrl);


		var orderStatusTime;  //定时器
		var checkOrderStatus;  //订单号
		
		
		
		// 首页banner
		$('#bootstrap-touch-slider').bsTouchSlider();

		// 点击返回顶部
		$('.rightFrame .placement').on('click', function () {
			$("html,body").animate({
				scrollTop: 0
			}, 1000);
		});

		// 点击预约课程以及点击关闭弹框
		$('.rightFrame .bespoke').on('click', function () {
			$(".appointShadow").css("display","block");
			$(".appoint").css("display","block");
		});	
		$('.appoint .close').on('click', function () {
			$(".appointShadow").css("display","none");
			$(".appoint").css("display","none");
		});


		// 订单列表
		orderData();
		var page = 1;
		// var current_page ;
		// var next_page_url = false;
		function orderData(){
			$.ajax({
                type: "get",
                dataType: "", // submit info
				url: url + '/web/box/list?userId='+$.cookie('uid'),
				data:{
					page:page
				},
                success: function (res) {
                    if (!res.resultStatus) {
                        $(".xz-alert").html(res.errorMessage);
                        $('.xz-alert').show();
                        setTimeout(function () {
                            $(".xz-alert").hide();
                        }, 2000);
                        return
					}
					var order = "";  //商品列表页书籍
					// var page = "";
					var orderArr = res.resultData;
					
                    for (var i = 0; i < orderArr.length; i++) {
						order += '<div class="item">' +
							'<div class="content">' +
								'<div class="shopList">'+
									'<div class="name">' +
										'<img src="'+ orderArr[i].bgPicture +'" alt="">' +
										'<div class="info">'+
										'<p class="monicker">'+ orderArr[i].caption +'</p>'+
										'<p class="num">单价:'+ orderArr[i].nowPrice +'</p>'+
									'</div>'+
								'</div></div>'+
							
							'<div class="people">'+ orderArr[i].type +'</div>'+
							'<div class="price">原价'+ orderArr[i].originalPrice +'元</div>'
							if(orderArr[i].saleStatus=='1'){
								order +='<div class="status">已处理</div></div></div>'
							}else if(orderArr[i].saleStatus=='2'){
								order +='<div class="status">未处理</div></div></div>'
							}
							order +='</div></div>'
							
					}


					$(".order .center").html(order);

					var _height = $(".item .content");
					for(var i = 0;i<_height.length;i++){
						$(_height[i]).children("div").css("height",_height[i].offsetHeight)
					}

					// 确认收货
					$(".member .right .receive").click(function(){
						var orderNo = $(this).attr("data-orderno");
						$.ajax({
							type: "post",
							dataType: "", // submit info
							url: url + '/v1/manager/mall/order?orderNo='+ orderNo + '&orderStatus=ORDERFINISH',
							success: function (res) {
								if (!res.resultStatus) {
									$(".xz-alert").html(res.errorMessage);
									$('.xz-alert').show();
									setTimeout(function () {
										$(".xz-alert").hide();
									}, 3000);
									return
								}
								$(".xz-alert").html("收货成功！");
			                    $('.xz-alert').show();
			                    setTimeout(function () {
									$(".xz-alert").hide();
									orderData();
								}, 1000);
							},
							error: function (e) {
								$(".xz-alert").html("提交数据失败");
								$('.xz-alert').show();
								setTimeout(function () {
									$(".xz-alert").hide();
								}, 3000);
							}
						})
			
						
					})
                },
                error: function (e) {
                    $(".xz-alert").html("请求数据失败");
                    $('.xz-alert').show();
                    setTimeout(function () {
                        $(".xz-alert").hide();
                    }, 2000);
                }
			})
	
		}

	</script>		

</body>

</html>